//
//  HomeViewController.swift
//  SinaWeibo
//
//  Created by 许良 on 16/6/1.
//  Copyright © 2016年 fading. All rights reserved.
//

import UIKit

class HomeViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        if !userLogin {
            visitorView?.setupVisitorInfo(true, imageName: "visitordiscover_feed_image_house", message: "关注一些人，回这里看看有什么惊喜")
            return
        }
        
        //初始化导航条
        setupNav()
        
    }
    
    private func setupNav () {
        
        
        //初始化左右按钮
        navigationItem.leftBarButtonItem = UIBarButtonItem.createBtnItem("navigationbar_friendsearch", target: self, action: #selector(HomeViewController.leftBtnClick), forControlEvents: .TouchUpInside)
        navigationItem.rightBarButtonItem = UIBarButtonItem.createBtnItem("navigationbar_pop", target: self, action: #selector(HomeViewController.rightBtnClick), forControlEvents: .TouchUpInside)
        
        
        //初始化标题按钮
        let titleBtn = TitleButton()
        titleBtn.setTitle("fading ", forState: .Normal)
        titleBtn.addTarget(self, action: #selector(HomeViewController.titleBtnClick(_:)) , forControlEvents: .TouchUpInside)
       

        navigationItem.titleView = titleBtn
    }
    
    
    func titleBtnClick (btn : TitleButton) {
        btn.selected = !btn.selected
        
    }
    func leftBtnClick () {
        
    }
    
    func rightBtnClick () {
        
    }
 
   
}
